﻿using System;
using System.Collections.Generic;
using RabbitMQ.Client;

namespace YEA.Infrastructure.Gateway.Stubs
{
    public class NullModel : IModel
    {
        public void Abort(ushort replyCode, string replyText)
        {
        }

        public void Abort()
        {
        }

        public void BasicAck(ulong deliveryTag, bool multiple)
        {
        }

        public event RabbitMQ.Client.Events.BasicAckEventHandler BasicAcks;

        public string BasicConsume(string queue, bool noAck, string consumerTag, bool noLocal, bool exclusive, IDictionary<string, object> arguments,
            IBasicConsumer consumer)
        {
            throw new NotImplementedException();
        }

        public void BasicCancel(string consumerTag)
        {
        }

        public string BasicConsume(string queue, bool noAck, string consumerTag, bool noLocal, bool exclusive, System.Collections.IDictionary arguments, IBasicConsumer consumer)
        {
            return "testconsumer";
        }

        public string BasicConsume(string queue, bool noAck, string consumerTag, System.Collections.IDictionary arguments, IBasicConsumer consumer)
        {
            return "testconsumer";
        }

        public string BasicConsume(string queue, bool noAck, string consumerTag, IBasicConsumer consumer)
        {
            return "testconsumer";
        }

        public string BasicConsume(string queue, bool noAck, string consumerTag, IDictionary<string, object> arguments, IBasicConsumer consumer)
        {
            throw new NotImplementedException();
        }

        public void WaitForConfirmsOrDie(TimeSpan timeout)
        {
        }

        public string BasicConsume(string queue, bool noAck, IBasicConsumer consumer)
        {
            return "testconsumer";
        }

        public BasicGetResult BasicGet(string queue, bool noAck)
        {
            return new BasicGetResult(1, false, "test","test",0, null, null);
        }

        public void BasicNack(ulong deliveryTag, bool multiple, bool requeue)
        {
        }

        public event RabbitMQ.Client.Events.BasicNackEventHandler BasicNacks;

        public void BasicPublish(string exchange, string routingKey, bool mandatory, IBasicProperties basicProperties, byte[] body)
        {
            throw new NotImplementedException();
        }

        public void BasicPublish(string exchange, string routingKey, bool mandatory, bool immediate, IBasicProperties basicProperties, byte[] body)
        {
        }

        public void BasicPublish(string exchange, string routingKey, IBasicProperties basicProperties, byte[] body)
        {
        }

        public void BasicPublish(PublicationAddress addr, IBasicProperties basicProperties, byte[] body)
        {
        }

        public void BasicQos(uint prefetchSize, ushort prefetchCount, bool global)
        {
        }

        public void BasicRecover(bool requeue)
        {
        }

        public void BasicRecoverAsync(bool requeue)
        {
        }

        public event RabbitMQ.Client.Events.BasicRecoverOkEventHandler BasicRecoverOk;

        public void BasicReject(ulong deliveryTag, bool requeue)
        {
        }

        public event RabbitMQ.Client.Events.BasicReturnEventHandler BasicReturn;

        public event RabbitMQ.Client.Events.CallbackExceptionEventHandler CallbackException;

        public void ChannelFlow(bool active)
        {
        }

        public void Close(ushort replyCode, string replyText)
        {
        }

        public void Close()
        {
        }

        public ShutdownEventArgs CloseReason
        {
            get { return new ShutdownEventArgs(new ShutdownInitiator(), 1, "test"); }
        }

        public void ConfirmSelect()
        {
        }

        public IBasicProperties CreateBasicProperties()
        {
            throw new NotImplementedException();
        }

        public IFileProperties CreateFileProperties()
        {
            throw new NotImplementedException();
        }

        public IStreamProperties CreateStreamProperties()
        {
            throw new NotImplementedException();
        }

        public void ExchangeDeclare(string exchange, string type, bool durable, bool autoDelete, IDictionary<string, object> arguments)
        {
        }

        public IBasicConsumer DefaultConsumer
        {
            get
            {
                throw new System.NotImplementedException();
            }
            set
            {
            }
        }

        public void DtxSelect()
        {
        }

        public void DtxStart(string dtxIdentifier)
        {
        }

        public void ExchangeBind(string destination, string source, string routingKey, IDictionary<string, object> arguments)
        {
        }

        public void ExchangeBind(string destination, string source, string routingKey)
        {
        }

        public void ExchangeUnbind(string destination, string source, string routingKey, IDictionary<string, object> arguments)
        {
        }

        public void ExchangeBind(string destination, string source, string routingKey, System.Collections.IDictionary arguments)
        {
        }

        public void ExchangeDeclare(string exchange, string type)
        {
        }

        public void ExchangeDeclare(string exchange, string type, bool durable)
        {
        }

        public void ExchangeDeclare(string exchange, string type, bool durable, bool autoDelete, System.Collections.IDictionary arguments)
        {
        }

        public void ExchangeDeclarePassive(string exchange)
        {
        }

        public void ExchangeDelete(string exchange)
        {
        }

        public void ExchangeDelete(string exchange, bool ifUnused)
        {
        }

        public void ExchangeUnbind(string destination, string source, string routingKey)
        {
        }

        public void ExchangeUnbind(string destination, string source, string routingKey, System.Collections.IDictionary arguments)
        {
        }

        public event RabbitMQ.Client.Events.FlowControlEventHandler FlowControl;

        public bool IsOpen
        {
            get { return true; }
        }

        public bool IsClosed { get; private set; }

        public event RabbitMQ.Client.Events.ModelShutdownEventHandler ModelShutdown;

        public ulong NextPublishSeqNo
        {
            get { return 1; }
        }

        public void QueueBind(string queue, string exchange, string routingKey, IDictionary<string, object> arguments)
        {
        }

        public void QueueBind(string queue, string exchange, string routingKey)
        {
        }

        public void QueueUnbind(string queue, string exchange, string routingKey, IDictionary<string, object> arguments)
        {
        }

        public void QueueBind(string queue, string exchange, string routingKey, System.Collections.IDictionary arguments)
        {
        }

        public QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive, bool autoDelete, System.Collections.IDictionary arguments)
        {
            return new QueueDeclareOk("test", 0, 1);
        }

        public QueueDeclareOk QueueDeclare()
        {
            return new QueueDeclareOk("test", 0, 1);
        }

        public QueueDeclareOk QueueDeclarePassive(string queue)
        {
            return new QueueDeclareOk("test", 0, 1);
        }

        public QueueDeclareOk QueueDeclare(string queue, bool durable, bool exclusive, bool autoDelete, IDictionary<string, object> arguments)
        {
            return new QueueDeclareOk(queue, 1, 1);
        }

        public uint QueueDelete(string queue)
        {
            return 0;
        }

        public uint QueueDelete(string queue, bool ifUnused, bool ifEmpty)
        {
            return 0;
        }

        public uint QueuePurge(string queue)
        {
            return 0;
        }

        public void QueueUnbind(string queue, string exchange, string routingKey, System.Collections.IDictionary arguments)
        {
        }

        public void TxCommit()
        {
        }

        public void TxRollback()
        {
        }

        public void TxSelect()
        {
        }

        public bool WaitForConfirms()
        {
            return true;
        }

        public bool WaitForConfirms(TimeSpan timeout, out bool timedOut)
        {
            timedOut = false;
            return true;
        }

        public void WaitForConfirmsOrDie()
        {
        }

        public void Dispose()
        {
        }
    }
}
